<!DOCTYPE html>
<html lang="en">
<head>
  <title>浩然金融中心管理平台</title>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"
        name="viewport">
  <#include "/common/csslib.html">
  <script type="text/javascript">
      var roleResourceTable;
  </script>
</head>
<body>
<div class="main-wrapper">
  <!-- start: MAIN CONTAINER -->
  <div class="main-container inner">
    <!-- start: PAGE -->
    <div class="main-content">
      <div class="container">
        <!-- 当前位置 begin -->
        <div class="row h-home-path">
          <div class="col-md-12">
            <ol class="breadcrumb">
              <li><i class="fa fa-home"></i>&nbsp;&nbsp;所在位置</li>
              <li>首页</li>
              <li class="active">角色资源</li>
            </ol>
          </div>
        </div>
        <!-- 当前位置 end -->

        <!-- 查询筛选内容 bagin -->
        <div class="row h-main-search">
          <form action="javascript:;" method="post">
          </form>
        </div>

        <!-- 表格 begin -->
        <div class="panel panel-white h-panel">
          <div class="panel-body">
            <table class="table table-striped table-bordered table-hover text-center" id="roleResource_table"
                   style='width:100%'></table>
          </div>
        </div>
        <!-- 表格 end -->
      </div>
    </div>
    <!-- end: PAGE -->
  </div>
  <!-- end: MAIN CONTAINER -->
  <!-- 新增 end -->
  <!-- end: SUBVIEW SAMPLE CONTENTS -->
</div>
<#include "/common/jslib.html">

<script type="text/javascript">
    $(function () {
        RoleResourceManager = {
            search: function () {
                var queryCond = {};
                roleResourceTable.options.queryCond = queryCond;
                var tableId = roleResourceTable.options.tableId;
                $(tableId).DataTable().draw();
            },
            addRoleResource: function () {
                window.location.href = "/securityRoleResource/to-form?operation=add";
            },
            deleteRoleResource: function (url, id) {
                var data = {
                    "id": id
                };
                Jmts.deleteItem("确认要删除吗？", url, data, function (result) {
                    if (result.success) {
                        Jmts.succTips("删除成功");
                      RoleResourceManager.search();
                    }
                });
            },
        }
    });
</script>
<!-- 弹窗下拉 -->
<script type="text/javascript">
    (function () {
        // datatable插件
        roleResourceTable = new mi.datatable({
            tableId: '#roleResource_table',
            headerList: [
                '角色名称',
                '角色说明',
                '资源名称'
            ],
            headerName: [
                'roleName',
                'roleComment',
                'resName'
            ],
            ajaxUrl: '/securityRoleResource/listRoleResource',
            queryCond: function () {

            },
            columnDefs: [],
            createdRow: function (row, data, dataIndex) {
                $(row).children('td').eq(0).attr('style',
                    'text-align:left;');
                $(row).children('td').eq(1).attr('style',
                    'text-align:left;');
                $(row).children('td').eq(2).attr('style',
                    'text-align:left;');
            },
            dataSrc: function (data) {
                return data;
            }
        });
    })();
</script>
</body>
</html>
